﻿@{
    if (IsPost)
    {
        if (Request.Form["actionButton"] == "download_blanksheet")
        {
            byte[] fileBytes = KeppelLand.Controllers.ReportController.GetOriginalOvertimeForm();
            Response.Clear();
            Response.ContentType = KeppelLand.Helpers.TranslationHelper.GetContentType(Request.Form["download_format"]);
            Response.AddHeader("content-disposition", "attachment; filename=overtime_form.xls");
            Response.BinaryWrite(fileBytes);
            Response.Flush();
            Response.End();
        } // if (Request.Form["actionButton"] == "download_blanksheet")
    }
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>@Page.Title | Staff Overtime: SOT</title>

    <!-- Bootstrap -->
    <link href="@VirtualPathUtility.ToAbsolute("~/Content/bootstrap.min.css")" rel="stylesheet">
    <link href="@VirtualPathUtility.ToAbsolute("~/Content/kendo/2014.3.1119/kendo.common.min.css")" rel="stylesheet">
    <link href="@VirtualPathUtility.ToAbsolute("~/Content/kendo/2014.3.1119/kendo.default.min.css")" rel="stylesheet">
    <link href="@VirtualPathUtility.ToAbsolute("~/Content/Site.css")" rel="stylesheet">

    <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.common.min.css" />
    <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.default.min.css" />
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    @RenderSection("Styles", required: false)
</head>
<body class="high-contrast">
    
    <!-- Fixed navbar -->
    <nav class="navbar navbar-fixed-top">
        <table cellpadding="0" cellspacing="0" width="100%" style="background-color:#ff9900; background-image:url(Images/SSO-BG.gif);">
            <tbody>
                <tr>
                    <td width="292"><img src="~/Images/SSO-Thinking-Unboxed-Logo.gif" alt="Keppel Land"></td>
                    <td class="application-name">Staff Overtime: SOT</td>
                    <td align="right"><a href="http://k2portal/SSO"><img src="~/Images/SSO-Logo.gif" border="0"></a></td>
                    <td width="10"></td>
                </tr>
            </tbody>
        </table>
        <div class="container-fluid high-contrast" style="background-image:url(Images/SSO-Menubar-BG.gif);">
            <div class="navbar-header">

                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @*<img src="~/Images/Keppel-Land-Thinking-Unboxed.png" />*@
                @*<a class="navbar-brand" href="@VirtualPathUtility.ToAbsolute("~/")">Staff-Overtime</a>*@

            </div>
            <div id="navbar" class="navbar-collapse collapse">
                <ul class="nav navbar-nav">

                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle sso-menu" data-toggle="dropdown" role="button" aria-expanded="false">Claim <span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="@VirtualPathUtility.ToAbsolute("~/New-Claim.cshtml")">Add/Edit/Submit</a></li>
                            <li><a href="@VirtualPathUtility.ToAbsolute("~/Retrieve-Submission.cshtml")">Retrieve Claim</a></li>
                            <li class="divider"></li>
                            <li><a href="@VirtualPathUtility.ToAbsolute("~/Claim-History.cshtml")">View History</a></li>
                            <li class="divider"></li>
                            <li>
                                <button type="button" class="btn btn-link btn-menulink" onclick="download_blanksheet('Excel');">Download Manual Claim Form
                                </button>
                            </li>
                        </ul>
                    </li>

                    @if (KeppelLand.Controllers.B2EController.IsSupervisor(KeppelLand.Helpers.UserIdentityHelper.GetSupervisorName()))
                    { 
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle sso-menu" data-toggle="dropdown" role="button" aria-expanded="false">Supervisor <span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="@VirtualPathUtility.ToAbsolute("~/Approve-Claim.cshtml")">Approve/Reject Claim</a></li>
                            <li class="divider"></li>
                            <li><a href="@VirtualPathUtility.ToAbsolute("~/Employee-Claim-History.cshtml")">View History</a></li>
                        </ul>
                    </li>
                    }

                    @if (KeppelLand.Controllers.B2EController.IsSecretary(KeppelLand.Helpers.UserIdentityHelper.GetSecretaryName()))
                    {
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Secretary <span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="@VirtualPathUtility.ToAbsolute("~/Approval-Routing.cshtml")">Approval Routing</a></li>
                            
                            @if (
                                (HttpContext.Current.User.Identity.Name.EndsWith("yvonne.tay", StringComparison.InvariantCultureIgnoreCase))
                                || (HttpContext.Current.User.Identity.Name.EndsWith("zhixian.ong", StringComparison.InvariantCultureIgnoreCase))
                                )
                            {
                                <li class="divider"></li>
                                @*<li><a href="@VirtualPathUtility.ToAbsolute("~/Claim-Status.cshtml")">Claim Status</a></li>*@
                                <li><a href="@VirtualPathUtility.ToAbsolute("~/Reject-Claim-Secretary.cshtml")">Reject Claim</a></li>
                                <li><a href="@VirtualPathUtility.ToAbsolute("~/Claim-Status.cshtml")">Claim Status</a></li>
                            }
                            
                        </ul>
                    </li>
                    }

                    @if (KeppelLand.Controllers.B2EController.IsHR(KeppelLand.Helpers.UserIdentityHelper.GetHRName()))
                    { 
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Human Resource <span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="@VirtualPathUtility.ToAbsolute("~/Reject-Claim.cshtml")">1 HR Export to SAP</a></li>
                            <li><a href="@VirtualPathUtility.ToAbsolute("~/Export-Claim.cshtml")">2 Export Claims</a></li>
                            <li><a href="@VirtualPathUtility.ToAbsolute("~/Claim-Status.cshtml")">Claim Status</a></li>
                            <li><a href="@VirtualPathUtility.ToAbsolute("~/Approval-Routing.cshtml")">Approval-Routing</a></li>

                            <li class="divider"></li>
                            @*<li class="dropdown-header">For SAP Interface</li>*@
                            <li><a href="@VirtualPathUtility.ToAbsolute("~/Unlock-Export.cshtml")">Unlock Export</a></li>

                            <li class="divider"></li>
                            @*<li class="dropdown-header">View</li>*@
                            <li><a href="@VirtualPathUtility.ToAbsolute("~/Export-History.cshtml")">Export History</a></li>
                        </ul>
                    </li>
                    }
                    @*
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Developer's Test Pages <span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="~/TestEx.cshtml">Test Exception</a></li>
                            <!--
                            <li class="divider"></li>
                            <li class="dropdown-header">SAP Interface</li>
                            <li><a href="#">Export claims</a></li>
                            <li><a href="#">Unlock claims</a></li>
                            -->
                        </ul>
                    </li>
                    *@

                </ul>

                <ul class="nav navbar-nav" style="float:right;">
                    <li class="top-menuitem">
                        <!--
        <button type="button" class="btn-link" data-toggle="modal" data-target="#helpModal">
            <span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> Help
        </button>
            -->
                        <a href="~/Content/User_Manual.pdf">
                            <img src="~/Images/help_icon.gif" /> Help
                        </a>
                    </li>

                    <li class="top-menuitem">
                        <a href="http://k2portal">
                            <img src="~/Images/k2portal_icon.gif" /> K2Portal
                        </a>
                    </li>

                    <li >
                        <span>
                            @if (KeppelLand.Helpers.UserIdentityHelper.IsSimulatingInputDate())
                            {
                                <text>(simulate date @KeppelLand.Helpers.UserIdentityHelper.GetInputDate())</text>
                            }
                            else
                            {
                                <text>(@DateTime.Now.ToString("dd MMM yyyy"))</text>
                            }
                            @DisplayHelper.LegalName(KeppelLand.Helpers.UserIdentityHelper.GetClaimantName())
                        </span>
                    </li>
                    <!--
                <li class="active"><a>@User.Identity.Name</a></li>
                <li><a href="#about">About</a></li>
                <li><a href="#contact">Contact</a></li>

                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Drop down<span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="#">Logout</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li class="divider"></li>
                        <li class="dropdown-header">Nav header</li>
                        <li><a href="#">Separated link</a></li>
                        <li><a href="#">One more separated link</a></li>
                    </ul>
                </li>
                -->
                </ul>
            </div><!--/.nav-collapse -->
        </div>
    </nav>

    @RenderBody()

    <form method="post" name="top_form" id="top_form">
        <input type="hidden" name="actionButton" id="actionButton" />
        <input type="hidden" name="download_format" id="download_format" />
    </form>

    <script src="@VirtualPathUtility.ToAbsolute("~/Scripts/jquery-1.9.1.min.js")"></script>
    <script src="@VirtualPathUtility.ToAbsolute("~/Scripts/bootstrap.min.js")"></script>
    <script type="text/javascript">
        function download_blanksheet(format) {
            $("#top_form #actionButton").val("download_blanksheet");
            $("#top_form #download_format").val(format);
            $("#top_form").submit();
        }
    </script>
    @RenderSection("Scripts", required: false)
</body>
</html>